Skip to content

Include mpy-cross '__init__.py' In Packages; Restructure Package Bundling #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 7, 2019

Conversation

sommersoft
Copy link
Collaborator

  • Fixes Enable mpy-cross compilation of some/all __init__.py files in libraries #29, by removing the exclusion of compiling __init__.py with mpy-cross, for packaged libraries. Zero-byte files are still excluded.

  • Partially fixes Fix Repo Artifacts in '/lib/' #30:

    • Adds a command line argument package_folder_prefix to use for determining which folder(s) to include with packaged libraries. This changes from an exclusive approach to an inclusive approach, while still allowing some flexibility. (could be expanded to use a list of prefixes in the future)
    • Still allows examples to pass through.
    • Will require an update to any .travis.yml directives to include the prefix string (I used adafruit_ in my testing)

@sommersoft sommersoft requested review from tannewt and kattni May 3, 2019 03:06
@sommersoft
Copy link
Collaborator Author

Please don't merge yet.

@jedgarpark brought up an issue with adafruit_imageload; its missing the bmp subfolder in the releases.

This PR doesn't fix it either, so I'll add it here.

@sommersoft
Copy link
Collaborator Author

sommersoft commented May 6, 2019

Ok, reworked file selection when building the file list. It now includes package subfolders (adafruit_library/subfolder). Fixes previous comment, which was identified in Issue 5 on the ImageLoad repo.

A side effect of this change, is that example subfolders are also included, but not annotated with the library name. Currently only one repo has example subfolders: LSM303. This requires a much larger change, and falls in line with #28.
Visual Reference:

(.env) ~/Dev/cpy-build-tools/.bundles:$> unzip -l test-4.x-mpy-732c144.zip
Archive:  test-4.x-mpy-732c144.zip
{"build-tools-version": "devel"}
  Length      Date    Time    Name
---------  ---------- -----   ----
    12327  2019-05-06 10:39   test-4.x-mpy-732c144/VERSIONS.txt
#-> package subfolders:
      485  2019-05-06 10:39   test-4.x-mpy-732c144/lib/adafruit_imageload/__init__.mpy
      749  2019-05-06 10:39   test-4.x-mpy-732c144/lib/adafruit_imageload/bmp/__init__.mpy
      747  2019-05-06 10:39   test-4.x-mpy-732c144/lib/adafruit_imageload/bmp/indexed.mpy
 
      309  2019-05-06 10:39   test-4.x-mpy-732c144/examples/crickit_dc_motor_simpletest.py
#-> example subfolders:
      347  2019-05-06 10:39   test-4.x-mpy-732c144/examples/fast_accel/fast_accel.py
      328  2019-05-06 10:39   test-4.x-mpy-732c144/examples/fast_mag/fast_mag.py
      859  2019-05-06 10:39   test-4.x-mpy-732c144/examples/raw_and_cooked/raw_and_cooked.py

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@kattni kattni merged commit 44c0748 into adafruit:master May 7, 2019
@kevinjwalters
Copy link

What triggers the creation of a new library bundle? I thought they might just be periodic but the dates aren't regular so it suggests there's perhaps a (rate limiited?) change based approach here?

Is there a way to manually request a new bundle release to pick up the effects of this (non-library) change?

@kevinjwalters
Copy link

Just seen a new bundle so please ignore the previous comment or thank-you for prodding it,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Repo Artifacts in '/lib/' Enable mpy-cross compilation of some/all __init__.py files in libraries
3 participants